# $Id: PKGBUILD 83512 2013-02-02 11:41:51Z jlichtblau $
# Maintainer: Jaroslav Lichtblau <dragonlord@aur.archlinux.org>
# Contributor: Jeff Mickey <j@codemac.net>

pkgname=cjc
pkgver=1.2.1
pkgrel=2
pkgdesc="Jabber client with text-based user interface resembling those known from popular IRC clients"
arch=('any')
url="http://cjc.jajcus.net/"
license=('GPL')
depends=('python2-pyxmpp')
changelog=$pkgname.changelog
source=(http://cjc.jajcus.net/downloads/$pkgname-$pkgver.tar.gz)
sha256sums=('8dcfb6969576b16d4ee6d8191751dea118dd9fd9efdba6ce524a6dcfb9196606')

package() {
  cd ${srcdir}/$pkgname-$pkgver

  # python2 fix
  sed -i 's_python_python2_' Makefile
  for file in $(find . -name '*.py' -print) cjc.in; do
    sed -i 's_^#!.*/usr/bin/python_#!/usr/bin/python2_' $file
    sed -i 's_^#!.*/usr/bin/env.*python_#!/usr/bin/env python2_' $file
  done

  sed -r 's@/usr/local@/usr@g' -i Makefile
  make DESTDIR=${pkgdir} install
}
